<template>
  <div class="shop" v-loading="loading">
    <el-form ref="form" :model="form" label-width="80px" label-position="top" class="myform">
      <div>
        <el-form-item label="店铺名称">
          <el-input v-model="form.name" placeholder="请输入店铺名称" clearable></el-input>
        </el-form-item>
      </div>
      <div>
        <el-form-item style="margin-top:50px">
          <el-button type="primary" size="default">搜索</el-button>
          
        </el-form-item>
      </div>
    </el-form>
    <el-table :data="shopList" style="width: 100%" border>
      <el-table-column label="店铺id" align="center" prop="id">
      </el-table-column>
      <el-table-column label="店铺名称" align="center" prop="shop_name">
      </el-table-column>
      <el-table-column label="店铺地址" align="center" prop="shop_address">
      </el-table-column>
      <el-table-column label="店铺简介" align="center" prop="shop_introduce">
        <template slot-scope="scope"
          ><div v-html="scope.row.shop_introduce"></div
        ></template>
      </el-table-column>
    </el-table>
    <pagination />
  </div>
</template>

<script>
import { getApiGetshoplist,postHomeOpenProcessingOrderUpload } from "@/api";
import pagination from "@/components/pagination.vue";
export default {
  components: { pagination },
  data() {
    return {
      loading:true,
      form:{
        name:""
      },
      shopList: [],
    };
  },
  async activated() {
    // postHomeOpenProcessingOrderUpload().then(res=>{
    //   console.log("测试-----------》",res);
    // })
    await this.getApiGetshoplist();
    this.loading = false
  },
  methods: {
    //门店列表
    async getApiGetshoplist() {
      await getApiGetshoplist().then((res) => {
        console.log("门店列表", res);
        this.shopList = res.data;
      });
    },
  },
};
</script>

<style lang="scss" scoped>
.shop {
   @include global-back;
}
.myform{
  display: flex;
  justify-content: space-between;
}
</style>